package cn.iocoder.yudao.module.erp.dal.mysql.business.produce.produceprocess;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.business.produce.produceprocess.vo.ProduceProcessPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.business.produce.produceprocess.ProduceProcessDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 工序 Mapper
 *
 * @author yy
 */
@Mapper
public interface ProduceProcessMapper extends BaseMapperX<ProduceProcessDO> {

    default PageResult<ProduceProcessDO> selectPage(ProduceProcessPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProduceProcessDO>()
                .eqIfPresent(ProduceProcessDO::getCode, reqVO.getCode())
                .likeIfPresent(ProduceProcessDO::getName, reqVO.getName())
                .betweenIfPresent(ProduceProcessDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProduceProcessDO::getId));
    }

}